function shortTitle(title,len) {
  if(!title){
    return ''
  }
  return title.substr(0,len) + '...'
}

function genNavParams(json) {
  let str = '';
  for (let key in json) {
    str += key + '=' + json[key] + '&'
  }
  return '?' + str.substr(0,str.length - 1)
}

module.exports = {
  shortTitle: shortTitle,
  genNavParams: genNavParams,
}
